package com.selfdriving.adapter;

import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.selfdriving.BaseApplication;
import com.selfdriving.BaseObjectListAdapter;
import com.selfdriving.R;
import com.selfdriving.bean.Entity;
import com.selfdriving.bean.Join;

public class FeatureJoinAdapter extends BaseObjectListAdapter
{
	public FeatureJoinAdapter(BaseApplication application, Context context,
			List<? extends Entity> datas)
	{
		super(application, context, datas);
	}

	@Override
	public View getView(int poistion, View view, ViewGroup arg2)
	{
		HolderView holderView;
		if (view == null)
		{
			holderView = new HolderView();
			view = mInflater.inflate(R.layout.feature_join_item, null);
			holderView.icon = (ImageView) view
					.findViewById(R.id.user_item_iv_avatar);
			holderView.name = (TextView) view.findViewById(R.id.city);
			view.setTag(holderView);
		} else
		{
			holderView = (HolderView) view.getTag();
		}
		Join join = (Join) mDatas.get(poistion);
		holderView.name.setText(join.getCity());
		mApplication.imageLoader.displayImage(join.getImg(), holderView.icon,
				mApplication.options);
		return view;
	}

	private class HolderView
	{
		private ImageView icon;

		private TextView name;

		private TextView num;
	}

}
